import os
from db import db_handler
from conf import setting


#1.用户查看日志的功能
def check_records_interface(name,addr):
    user_dic=db_handler.select(name)
    log_list=[]
    all_log_list=os.listdir(addr)
    for line in all_log_list:
        if name in line:
            log_list.append(line)

    if len(log_list)==0:
        return False, '%s %s 暂无信息，请稍后查询' % (user_dic['role'], name)
    else:
        return True,log_list









